package com.morehair.service.wx.impl;

import com.morehair.bean.pojo.Region;
import com.morehair.bean.pojo.RegionExample;
import com.morehair.bean.vo.wx.RegionListVo;
import com.morehair.mapper.RegionMapper;
import com.morehair.service.wx.WxRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class WxRegionServiceImp implements WxRegionService {

    @Autowired
    RegionMapper regionMapper;

    @Override
    public List<Region> getRegionList(int pid) {


        //根据pid选出将要返回的Regions
        RegionExample regionExample = new RegionExample();
        RegionExample.Criteria criteria = regionExample.createCriteria();
        criteria.andPidEqualTo(pid);
        List<Region> regions = regionMapper.selectByExample(regionExample);


        return regions;
    }
}
